<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>v-on补充</title>
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<input type="button" value="点击" @click="doIt(666,'老铁')" />
			<!-- 点击回车键，再触发事件sayHi -->
			<input type="text" @keyup.enter="sayHi"/>			
		</div>
		
		<script type="text/javascript">
			var app = new Vue({
				el: "#app",
				data:{
					
				},
				methods:{
					doIt:function(p1,p2){
						console.log("做it");
						console.log(p1);
						console.log(p2);
					},
					sayHi:function(){
						alert("吃饭了没有")
					}
				}
				
			})
		</script>
	</body>
</html>
